package edu.bbu.BS.swing;

import javax.naming.InitialContext;
import javax.naming.NamingException;





import edu.bbu.bs.backend.model.Author;
import edu.bbu.bs.backend.service.AuthorService;

public class Main {	
	public static void main(String[] args) {
		try {
			InitialContext ic = new InitialContext();
			final AuthorService service = (AuthorService) ic.lookup("java:global/BS-Server/BS-backend-0.0.1-SNAPSHOT/AuthorService!edu.bbu.bs.backend.service.AuthorService");
			service.insertAuthor(new Author("Simon", "Karoly"));
			System.out.println(service.getAuthor(1L));
			
			// final RemoteService service = (RemoteService) ic.lookup("java:global/bs-server/bs-backend-0.0.1-SNAPSHOT/RemoteService");
			// System.out.println(service.sayHello());
		} catch (NamingException e) {
			e.printStackTrace();
		}
	}

}
